package com.bifrost.model;

import com.bifrost.validator.group.IsAdd;
import com.bifrost.validator.group.IsUpdate;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;

/**
 * @com.bifrost.model
 * @wechat-mall
 * @lee Create Class on 2018/4/10
 */
@Data
public class CategoryModel implements Serializable {


        @NotNull(message = "分类id不能为空" , groups = IsUpdate.class)
        @Null(message = "分类id必须为空" , groups = IsAdd.class)
        private Long categoryId;

        private String categoryDescription;

        @NotBlank(message = "分类名称不能为空")
        private String categoryName;
        //@NotBlank(message = "分类编码不能为空")
        private String categoryCode;

        @NotNull(message = "是否可用不能为空")
        private Boolean isVisible;

        private Long parentId;

        private int sortOrder = 1;

        private String categoryImg;

        @ApiModelProperty(name = "bonusPointsRate" , value = "品类积分率")
        private Integer bonusPointsRate=0;
        @NotBlank(message = "分类图片不能为空")
        private String hash;
}
